# $Id: PKGBUILD 183194 2013-04-18 17:14:21Z andyrtr $
# Maintainer: tobias <tobias@archlinux.org>
# Contributor: Low Kian Seong <fastmail_low@speedymail.org>

pkgname=bogofilter
pkgver=1.2.3
pkgrel=1
pkgdesc="A fast Bayesian spam filtering tool"
arch=('i686' 'x86_64')
license=('GPL3')
url="http://bogofilter.sourceforge.net"
depends=('db' 'perl' 'gsl')
backup=('etc/bogofilter/bogofilter.cf')
source=(http://sourceforge.net/projects/${pkgname}/files/${pkgname}-current/${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.bz2)
md5sums=('c3ed7f483b83abcbf6d8c797084bd06e')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
              --sysconfdir=/etc/bogofilter  \
              --localstatedir=/var \
              --enable-transactions
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  mv "${pkgdir}/etc/bogofilter/bogofilter.cf.example" "${pkgdir}/etc/bogofilter/bogofilter.cf"

  install -dm755 "${pkgdir}/usr/share/${pkgname}/contrib"
  install -m644 contrib/* "${pkgdir}/usr/share/${pkgname}/contrib/"
}
